<?php

use yii\db\Migration;

class m161031_042020_create_recover extends Migration
{
    public function up()
    {
        $this->createTable('kd_recover',[
            'id'=>$this->primaryKey()->comment('id'),
            'gtable'=>$this->string(20)->comment('关联的表名'),
            'class_name'=>$this->string(20)->notNull()->comment('类名称'),
            'deleted_by'=>$this->string(20)->notNull()->comment('删除人'),
            'delete_time'=>$this->dateTime()->notNull()->comment('删除时间'),
            'route'=>$this->string(20)->comment('查看的路径'),
            'fid'=>$this->integer(10)->comment('外键'),
        ]);
    }

    public function down()
    {
        $this->dropTable('kd_recover');
    }

    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}
